package com.ruoyi.system.domain.xs;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;

/**
 * TB 订单表
 * @TableName xs_order_tb
 */
@TableName(value ="xs_order_tb")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class XsOrderTb extends BaseEntity {

    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 内部订单id
     */
    private String orderId;

    /**
     * 淘宝订单唯一ID
     */
    private String acookieId;

    /**
     * 支付单号
     */
    private String paymentId;

    /**
     * 订单状态(1交易关闭，2交易成功，3买家已付款,等待卖家发货，4卖家已发货，等待买家确认)
     */
    private String status;

    /**
     * 订单状态说明
     */
    private String statusDescr;

    /**
     * 商品标题
     */
    private String title;

    /**
     * 买家应付金额
     */
    private BigDecimal buyerPayableGoods;

    /**
     * 买家应付邮费
     */
    private BigDecimal buyerPayableShipping;

    /**
     * 订单付款时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date payTime;

    /**
     * 交易结束时间
     */
    private Date endTime;

    /**
     * 买家实际支付金额
     */
    private BigDecimal actualPayment;

    /**
     * 备注内容
     */
    private String sellerMemo;

    /**
     * 账户
     */
    private String account;

    /**
     * 是否报账（1报，2未报, 3重复报账, 4不报）
     */
    private String checkSheet;

    /**
     * 结款日期
     */
    private Date settlementDate;

    /**
     * 结款备注
     */
    private String settlementRemark;

    /**
     * 绩效月份
     */
    private String performance;

    /**
     * 订单类型
     */
    private Integer orderType;

    /**
     * 订单来源
     */
    private String orderSource;

    /**
     * 退款
     */
    private String refund;

    /**
     * 是否刷单（1是，2否）
     */
    private String ifBrushing;

    /**
     * 店铺编号
     */
    private String storeCode;

    /**
     * 是否结算（1是，2否，3重复报账）
     */
    private String ifBalance;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        XsOrderTb other = (XsOrderTb) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
            && (this.getAcookieId() == null ? other.getAcookieId() == null : this.getAcookieId().equals(other.getAcookieId()))
            && (this.getPaymentId() == null ? other.getPaymentId() == null : this.getPaymentId().equals(other.getPaymentId()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getBuyerPayableGoods() == null ? other.getBuyerPayableGoods() == null : this.getBuyerPayableGoods().equals(other.getBuyerPayableGoods()))
            && (this.getBuyerPayableShipping() == null ? other.getBuyerPayableShipping() == null : this.getBuyerPayableShipping().equals(other.getBuyerPayableShipping()))
            && (this.getPayTime() == null ? other.getPayTime() == null : this.getPayTime().equals(other.getPayTime()))
            && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
            && (this.getActualPayment() == null ? other.getActualPayment() == null : this.getActualPayment().equals(other.getActualPayment()))
            && (this.getSellerMemo() == null ? other.getSellerMemo() == null : this.getSellerMemo().equals(other.getSellerMemo()))
            && (this.getAccount() == null ? other.getAccount() == null : this.getAccount().equals(other.getAccount()))
            && (this.getCheckSheet() == null ? other.getCheckSheet() == null : this.getCheckSheet().equals(other.getCheckSheet()))
            && (this.getSettlementDate() == null ? other.getSettlementDate() == null : this.getSettlementDate().equals(other.getSettlementDate()))
            && (this.getSettlementRemark() == null ? other.getSettlementRemark() == null : this.getSettlementRemark().equals(other.getSettlementRemark()))
            && (this.getPerformance() == null ? other.getPerformance() == null : this.getPerformance().equals(other.getPerformance()))
            && (this.getOrderType() == null ? other.getOrderType() == null : this.getOrderType().equals(other.getOrderType()))
            && (this.getOrderSource() == null ? other.getOrderSource() == null : this.getOrderSource().equals(other.getOrderSource()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getRefund() == null ? other.getRefund() == null : this.getRefund().equals(other.getRefund()))
            && (this.getIfBrushing() == null ? other.getIfBrushing() == null : this.getIfBrushing().equals(other.getIfBrushing()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
        result = prime * result + ((getAcookieId() == null) ? 0 : getAcookieId().hashCode());
        result = prime * result + ((getPaymentId() == null) ? 0 : getPaymentId().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getBuyerPayableGoods() == null) ? 0 : getBuyerPayableGoods().hashCode());
        result = prime * result + ((getBuyerPayableShipping() == null) ? 0 : getBuyerPayableShipping().hashCode());
        result = prime * result + ((getPayTime() == null) ? 0 : getPayTime().hashCode());
        result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
        result = prime * result + ((getActualPayment() == null) ? 0 : getActualPayment().hashCode());
        result = prime * result + ((getSellerMemo() == null) ? 0 : getSellerMemo().hashCode());
        result = prime * result + ((getAccount() == null) ? 0 : getAccount().hashCode());
        result = prime * result + ((getCheckSheet() == null) ? 0 : getCheckSheet().hashCode());
        result = prime * result + ((getSettlementDate() == null) ? 0 : getSettlementDate().hashCode());
        result = prime * result + ((getSettlementRemark() == null) ? 0 : getSettlementRemark().hashCode());
        result = prime * result + ((getPerformance() == null) ? 0 : getPerformance().hashCode());
        result = prime * result + ((getOrderType() == null) ? 0 : getOrderType().hashCode());
        result = prime * result + ((getOrderSource() == null) ? 0 : getOrderSource().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getRefund() == null) ? 0 : getRefund().hashCode());
        result = prime * result + ((getIfBrushing() == null) ? 0 : getIfBrushing().hashCode());
        return result;
    }
}
